Skip to main content

WindowObj

Wolfram Kernel
Execution environment
Notebook`Editor`Kernel`FrontSubmitService`
Context
WindowObj[assoc_Association]

an internal representation of a current window (can be a notebook or projected cell), that contains the information of a live connection to it used by FrontSubmit, FrontFetch, Slides and other functions.

Normally is produced by CurrentWindow.

Methods

EventHandler

You can attach an event listener to it. The following patterns are supported

  • "keydown"
  • "capturekeydown" - blocks normal input while capturing in the entire notebook

It returns EventObject generated from the window.

example

ev = EventHandler[CurrentWindow[], {
"keydown" -> Function[key,
If[key === "Escape", EventRemove[ev]];
Print[key];
]
}];
warning

It is only valid for a current window. If you reopened a notebook, one has to reattach an event handler to a new WindowObj.